from datetime import datetime

from pydantic import BaseModel, EmailStr
from typing import Optional, List

class SubmitSign(BaseModel):
    username: str
    password: str
    activityId: str


class SubmitTokenSign(BaseModel):
    username: str
    token: str
    activityId: str

class SubmitInfoRequest(BaseModel):
    username: str
    password: str
    email: EmailStr
    ids: Optional[List[int]] = None
    autoSignInTime:Optional[int] = None
    autoSignOutTime:Optional[int] = None

class SubmitInfoCreate(BaseModel):
    username: str
    password: str
    email: EmailStr
    ids: Optional[List[int]] = None


class SubmitInfoUpdate(BaseModel):
    nickName: Optional[str] = None
    username: Optional[str] = None
    password: Optional[str] = None
    activityName: Optional[str] = None
    email: Optional[EmailStr] = None
    ids: Optional[List[int]] = None
    isDelete: Optional[bool] = None
    isPush: Optional[bool] = None
    isSuccess: Optional[bool] = None
    remark: Optional[str] = None
    applyAt: Optional[datetime] = None


class SubmitInfoResponse(BaseModel):
    id: int
    username: Optional[str]
    password: Optional[str]
    email: Optional[str]
    ids: Optional[List[int]]
    isDelete: Optional[bool]

    class Config:
        from_attributes = True

